import axios from 'axios'

// 请求banner
function postBanner(type1) {
    return axios.post(`http://localhost:3000/banner?type=${type1}`).then((res) => {
        return res.data.banners;
    })
}
//圆形图标入口列表
function postIcon() {
    return axios.post(`http://localhost:3000/homepage/dragon/ball`).then((res) => {
        return res.data.data
    });
}

// 推荐歌单
function postRecommendMusic() {
    return axios.post(`http://localhost:3000/personalized?limit=10`).then((res) => {
        return res.data.result
    })
}
//热门歌单
function postHighqualityMusic() {
    return axios.post(`http://localhost:8080/personalized?limit=30`).then((res) => {
        return res.data.result
    })
}
//经典歌单
function classicMusicMusic() {
    return axios.post(`http://localhost:3000/personalized?limit=20`).then((res) => {
        return res.data.result
    })
}
//推荐新音乐
function postNewsongMusic() {
    return axios.post(`http://localhost:3000/personalized/newsong?limit=10`).then((res) => {
        return res.data.result
    })
}
//  歌单id
function postPlaylistDetail(id) {
    return axios.post(`http://localhost:3000/playlist/detail?id=${id}`)
}

//  获取歌曲详细
function postSongDetail(id) {
    return axios.post(`http://localhost:3000/song/detail?ids=${id}`)
}

//  获取歌词
function postLyric(id) {
    return axios.post(`http://localhost:3000/lyric?id=${id}`)
}


export { postBanner, postIcon, postRecommendMusic, postPlaylistDetail, postSongDetail, postLyric, postHighqualityMusic, postNewsongMusic, classicMusicMusic }
